Always report XInput events to the grab window if any.
authorCarlos Garnacho <carlos@gnome.org>
Mon, 21 Sep 2009 17:24:45 +0000 (19:24 +0200)
committerAlexander Larsson <alexl@redhat.com>
Mon, 21 Sep 2009 18:04:22 +0000 (20:04 +0200)
The grab window should be the first option to send events to, else we may
get unpaired events, making display->ignore_core_events go crazy.

https://bugzilla.gnome.org/show_bug.cgi?id=588649

gdk/x11/gdkinput-xfree.c

index 24a87f459feadda27799e1eb9209058180dffc1e..50bb94b5da20ab91ad6d1c623fb682e3df6b4bb9 100644 (file)
@@ -256,17 +256,18 @@ _gdk_input_other_event (GdkEvent *event,
   if (event_type == GDK_NOTHING)
     return FALSE;
 
-  window = _gdk_window_get_input_window_for_event (event_window,
-                                                  event_type,
-                                                  x, y,
-                                                  xevent->xany.serial);
   /* If we're not getting any event window its likely because we're outside the
      window and there is no grab. We should still report according to the
      implicit grab though. */
   iw = ((GdkWindowObject *)event_window)->input_window;
-  if (window == NULL)
-    window = iw->button_down_window;
 
+  if (iw->button_down_window)
+    window = iw->button_down_window;
+  else
+    window = _gdk_window_get_input_window_for_event (event_window,
+                                                     event_type,
+                                                     x, y,
+                                                     xevent->xany.serial);
   priv = (GdkWindowObject *)window;
   if (window == NULL)
     return FALSE;